package com.tl.sun.ui.adapter;

import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.tl.sun.R;
import com.tl.sun.model.IpUseEntity;

import java.util.List;

/**
 * 作者：HQY on 17/8/7 14:22
 * 邮箱：hqy_xz@126.com
 */

public class IpUseAdapter extends BaseQuickAdapter<IpUseEntity, BaseViewHolder> {


    public IpUseAdapter(List<IpUseEntity> data) {
        super(R.layout.item_ip_use, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, IpUseEntity item) {
        TextView mName = helper.getView(R.id.tv_use_name);
        mName.setText(item.getName());
        ImageView mCheck = helper.getView(R.id.iv_use_check);
        if (item.isShow()) {
            mCheck.setVisibility(View.VISIBLE);
            mName.setTextColor(mContext.getResources().getColor(R.color.main_text_check_color));
        } else {
            mCheck.setVisibility(View.GONE);
            mName.setTextColor(mContext.getResources().getColor(R.color.color_444444));

        }
    }
}
